package com.demo.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 医院科室信息表
 * @author zm
 * @since 2020-11-26
 */
@Data
@TableName("pd_department")
@ApiModel(value="Department对象", description="医院科室信息表")
public class Department implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "部门科室编号")
    @TableId(value = "dept_no", type = IdType.AUTO)
    private Integer deptNo;

    @ApiModelProperty(value = "病区名称")
    @TableField("dept_area_name")
    @NotBlank(message = "病区名称不能为空")
    private String deptAreaName;

    @ApiModelProperty(value = "病区编号")
    @TableField("dept_sn")
    @NotNull(message = "病区编号不能为空")
    private Integer deptSn;

    @ApiModelProperty(value = "病区映射")
    @TableField("dept_mapping")
    @NotNull(message = "病区映射不能为空")
    private Integer deptMapping;

    @ApiModelProperty(value = "类型1内科2外科")
    @TableField("dept_type")
    @NotNull(message = "类型不能为空")
    private Integer deptType;

    @ApiModelProperty(value = "所属科室")
    @TableField("dept_name")
    @NotBlank(message = "所属科室不能为空")
    private String deptName;

    @ApiModelProperty(value = "所属院区")
    @TableField("dept_hospital_disttrict")
    @NotBlank(message = "所属院区不能为空")
    private String deptHospitalDisttrict;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "created_time",fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;

    @ApiModelProperty(value = "创建人ID号")
    @TableField("created_user_id")
    @NotNull(message = "创建人ID号不能为空")
    private Integer createdUserId;

    @ApiModelProperty(value = "删除时间")
    @TableField("deleted_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deletedTime;

    @ApiModelProperty(value = "删除人ID号")
    @TableField("deleted_user_id")
    private Integer deletedUserId;

    @ApiModelProperty(value = "更新时间")
    @TableField(value = "updated_time",fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    @ApiModelProperty(value = "更新人ID号")
    @TableField("updated_user_id")
    private Integer updatedUserId;
}
